-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt to select stack then create as fallback #11402
Conversation
Changelog[uncommitted] (2022-11-18)Bug Fixes
|
a86dd9b
to
44d6862
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aq17 can you also reverse it for C# in this PR?
pulumi/sdk/dotnet/Pulumi.Automation/WorkspaceStack.cs
Lines 129 to 139 in 6a74bc1
WorkspaceStackInitMode.CreateOrSelect => Task.Run(async () => | |
{ | |
try | |
{ | |
await workspace.CreateStackAsync(name, cancellationToken).ConfigureAwait(false); | |
} | |
catch (StackAlreadyExistsException) | |
{ | |
await workspace.SelectStackAsync(name, cancellationToken).ConfigureAwait(false); | |
} | |
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I have 1 suggestion around simplifying the retry logic in Go. (also you have a small lint error)
88ce9a8
to
4465214
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
bors r+ |
Build succeeded: |
Description
Fixes #11392
If a user does not have write permission (i.e. read-only), attempting to create the stack first will fail before the stack select fallback is triggered. Flip the logic to select first, then create.
7695311 changed it for python auto API already, this PR does the same for TS, Go, C#
Checklist
make changelog
and committed thechangelog/pending/<file>
documenting my change